package com.fenqing.leetcode.code.lcp;


import com.fenqing.annotations.Execute;
import com.fenqing.bean.TreeNode;
import com.fenqing.core.Topic;

/**
 * @author fenqing
 */
public class Topic067 extends Topic {
    /**
     * 构造器
     *
     * @param input 输入
     */
    public Topic067(String... input) {
        super(input);
    }

    @Execute
    public TreeNode expandBinaryTree(TreeNode root) {
        if(root == null){
            return null;
        }
        if (root.left != null) {
            TreeNode temp = new TreeNode(-1);
            temp.left = expandBinaryTree(root.left);
            root.left = temp;
        }
        if (root.right != null) {
            TreeNode temp = new TreeNode(-1);
            temp.right = expandBinaryTree(root.right);
            root.right = temp;
        }
        return root;
    }

    public static void main(String[] args) {
        Topic067 topic67 = new Topic067("[7,5,6]");
        TreeNode run = topic67.run();
        System.out.println(run);
    }



}
